package br.com.iswe.gwt.ui.client.comp;

import br.com.iswe.gwt.util.client.FlatMap;

import com.google.gwt.user.client.ui.RadioButton;

public class RadioButtonBag extends RadioButton implements PropertiesBag{

	private FlatMap bean = FlatMap.getInstance();
	
	public RadioButtonBag(String group){
		super(group);
	}
	
	public RadioButtonBag(String group, String label){
		super(group, label);
		setStyleName("gwt-Label");
	}
	
	/* (non-Javadoc)
	 * @see br.com.iswe.gwt.ui.client.comp.PropertiesBag#getPropriedade(java.lang.String)
	 */
	public String getPropriedade(String chave) {
		return bean.getString(chave);
	}

	/* (non-Javadoc)
	 * @see br.com.iswe.gwt.ui.client.comp.PropertiesBag#setPropriedade(java.lang.String, java.lang.String)
	 */
	public void setPropriedade(String chave, String valor) {
		bean.put(chave, valor);
	}

	/* (non-Javadoc)
	 * @see br.com.iswe.gwt.ui.client.comp.PropertiesBag#setPropriedades(br.com.iswe.gwt.util.client.FlatMap)
	 */
	public void setBean(FlatMap bean) {
		this.bean.putAll( bean );
	}

	public FlatMap getBean() {
		return bean;
	}
	
}
